package com.marketfarm.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.History;
import com.marketfarm.client.CachePagina.Pagina;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class MainPage implements EntryPoint {
	public void onModuleLoad() {
		History.addValueChangeHandler(new HistoryHandler());

		String initToken = History.getToken();
	    if (initToken.length() == 0) {
	    	History.newItem(Pagina.LOGIN.toString());
	    }
	    else {
	    	History.fireCurrentHistoryState();
	    }
	}
}
